//
//  PageProtocol.swift
//  
//
//  Created by tank on 2021/9/30.
//

import Foundation
import UIKit
import LibUI
import LibService

/// page协议
public protocol PageProtocol: AnyObject {
    
    /// page type
    static var type: String { get }

    /// module
    var module: ModuleProtocol { get }

    var id: String? { get }

    var type: String { get }
    
    var config: PageConfig { get }
    
    /// url params
    var params: [String: Any]? { get }
    
    /// url hash
    var hash: String? { get }
    
    var completion: RouterServiceProtocol.RouteCompletion? { get set }
    
    var popDelta: Int { get set }
    
    var completionParam: Any? { get set }
    
    /// the view controller of page
    var viewController: PageController? { get }
    
    
    init(module: ModuleProtocol,
         id: String?,
         config: PageConfig?,
         params: [String : Any]?,
         hash: String?)

    func set(title: String?, subTitle: String?)
    
    func set(rightMenus: [MenuData]?)
}
